package com.java.jvm;

public class Counter {

	private static final Counter COUNTER = getInstance();//将count1和count2设为1
	public static int count1;
	public static int count2 = 0;//将count2设为0

	private Counter(){
		count1++;
		count2++;
	}
	public static Counter getInstance(){
		return new Counter();
	}

	public static void main(String[] args) {
		Counter counter = Counter.COUNTER;
		System.out.println(count1);
		System.out.println(count2);
	}
}
